package view.panel.item
{
	import control.panel.IPanelControl;
	
	import flash.display.DisplayObject;
	
	import view.panel.AbsPanel;
	
	import global.GameState;
	import utils.DisplayTool;
	
	public class ItemShortcutPanel extends AbsPanel
	{
		private var wIndex:int;
		public function ItemShortcutPanel(panelControl:IPanelControl)
		{
			super(panelControl);
		}
		
		public function addItem(displayObject:DisplayObject):void
		{
			wIndex++;
			if (displayObject)
			{
				addChild(displayObject);
			}
			
			resetBg(6 + 32 * wIndex,36);
			
			this.x = GameState.GAME_WIDTH - this.width;
			this.y = GameState.GAME_TABLE_HEIGHT - 30;
		}
		
		public function clear():void
		{
			wIndex = 0;
			DisplayTool.removeAllChild(this);
		}
	}
}